import { fileURLToPath, URL } from 'node:url'

import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig(({ mode }) => {
    const root = process.cwd();
    const viteEnv = loadEnv(mode, root);
    return {
        server: {
            port: 3000
        },
        plugins: [
            vue(),
            // vueDevTools(),
        ],
        base: '/backend',
        // base: viteEnv.VITE_PUBLIC_PATH,
        resolve: {
            alias: {
                '@': fileURLToPath(new URL('./src', import.meta.url))
            },
        },
    }
})

